import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'

axios.defaults.baseURL = 'http://localhost:3456'

axios.interceptors.request.use((config:AxiosRequestConfig) => {
  return config
})

axios.interceptors.response.use((response:AxiosResponse) => {
  return response.data.data
}, e => {
  console.error(e)
})

export default axios
